
CREATE TABLE TB_TREE_BUS
(
	OBJ_ID NUMBER(30) NOT NULL PRIMARY KEY,
	OBJ_NAME VARCHAR2(512) NOT NULL,
    P_OBJ_ID NUMBER(30) NOT NULL,
	OBJ_TYPE NUMBER(4),
	OBJ_TYPE_DESC VARCHAR2(64),
    SN NUMBER(4) ,
    ISVALID NUMBER(1),
    CREATE_TIME DATE,
    UPD_TIME  DATE
);
-- Create sequence 
create sequence TB_TREE_BUS_SEQ
minvalue 1
maxvalue 9999999999999999999999999999
start with 420
increment by 1
cache 10;

create or replace trigger TB_TREE_BUS_TRI
  before insert on tb_tree_bus  
  for each row
declare
 
begin
  select tb_tree_bus_seq.nextval into :new.OBJ_ID FROM sys.DUAL;
end TB_TREE_BUS_TRI;